public class Triangle extends Shape{
    // 定义三角形的三条边
    public double a;
    public double b;
    public double c;
    // 构造方法
    Triangle(){

    }
    public Triangle(String color, double a, double b, double c) {
        super(color);
        this.a = a;
        this.b = b;
        this.c = c;
    }
    // 计算三角形的面积（重写）
    public double area(){
        double s = (a+b+c)/2;
        return Math.sqrt(s*(s-a)*(s-b)*(s-c));
    }
    // 计算三角形的周长（重写）
    public double perimeter(){
        return a+b+c;
    }
    public double getA() {
        return a;
    }

    public void setA(double a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }

    public double getC() {
        return c;
    }

    public void setC(double c) {
        this.c = c;
    }
}
